package com.gump.essay.demo.design.facade;

/**
 * @auther zzc
 * @date 2020/12/9 14:30
 */
public class TakeawayService {

    private OrderService orderService = new OrderService();
    private PayService payService = new PayService();
    private DeliveryService deliveryService = new DeliveryService();
    
    public void takeOrder(Takeaway takeaway){
        if(orderService.placeAnOrder(takeaway)) {
            if(payService.pay(takeaway) ){
                deliveryService.delivery(takeaway);
                System.out.println("外卖已经送到拉");
            }
        };
    }
}
